package com.ushine.design.design.a_creative_mode.f_single.a_basic;

public class Singleton {
    //静态私有成员变量
    private static Singleton instance = null;

    //私有构造方法
    private Singleton() {
    }

    //静态公有工厂方法，返回唯一实例
    public static Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }

}
